﻿using System.Text;

namespace ChangeLog.CommunityToolkit.Models;

internal class ReleaseVersion
{
    public string Version { get; set; }= "Unreleased";
    public string Date { get; set; }
    //public string Type { get; set; }
    //public List<string> Descs { get; set; }
    public Dictionary<string,List<string>> TypeDescs=new ();
    //public List<CommitDetail> CommitDetails { get; set; }=new List<CommitDetail>();
    public override string ToString()
    {
        var sbDecs = new StringBuilder();
        TypeDescs.Keys.ToList().ForEach(type =>
        {
            sbDecs.Append($"### {ChangeLogHelper.TypeDcit[type]} \n \n");
            TypeDescs[type].ToList().ForEach(desc =>
            {
                sbDecs.Append($"* {desc} \n \n");
            });
        });

        return $@"## [{Version}] - {Date}

{sbDecs.ToString()}

";
    }
}